package lab02.test23;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

/**
 * Created by ASUS on 2017/10/29.
 */
public class Test {
    public static void main(String[] args) throws ParseException {
        String birthday;
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你的生日：");
        birthday=scanner.nextLine();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-mm-dd");
        Calendar calendar=Calendar.getInstance();
        calendar.setTime (sdf.parse(birthday));
        long time1=calendar.getTimeInMillis();
        calendar.setTime (sdf.parse("2017-11-02"));
        long time2=calendar.getTimeInMillis();
        System.out.println("天数:"+(time1-time2)/(24*60*60*1000));

        System.out.println("星期"+time1);
    }
}
